import React from 'react'
import {actions} from 'mirrorx'
import {FormattedMessage} from 'react-intl'

class App extends React.Component {
  constructor (props) {
    super(props)

    this.policyNo = T.urlQuery('policyNo') || ''
  }

  componentDidMount () {

  }

  render () {
    const Lang = window.LangMessage || {}
    return (<div className='tac success-page mb30'>
      <div className='success-wrap'>
        <img src='/assets/images/success.png' />
      </div>
      <div className='f34 fc6'>
        { Lang.surrender_success || 'Surrender successfully'}
      </div>
      <div className='mt30 fc8 f24'>
        <FormattedMessage id='policy_number' defaultMessage='Policy Number' />：{this.policyNo}
      </div>
      <div className='btn-div'>
        <div className='page-btn-1 f28' onClick={() => { window.location.href = '/product-detail-yj-en?policyNo=' + this.policyNo + '&state=2' }}>
          { Lang.scan_insure_order || 'view policy'}
        </div>
      </div>

      <div className='mt40'>
        <div className='page-btn-3 f28' onClick={() => { window.location.href = '/product-list-yj-en' }}>
          <FormattedMessage id='back_home' defaultMessage='back homepage' />
        </div>
      </div>
    </div>)
  }
}

export default App
